home *** CD-ROM | disk | FTP | other *** search
/ The Very Best of Atari Inside / The Very Best of Atari Inside 1.iso / mint / mntinc20 / limits.h < prev    next >
C/C++ Source or Header  |  1992-05-15  |  3KB  |  112 lines

  1. /*
  2.  *    LIMITS.H
  3.  *    see ansi draft sec 4.1.3 and 2.2.4.2
  4.  */
  5.  
  6. #ifndef    _LIMITS_H
  7. #define    _LIMITS_H
  8.  
  9. #ifndef _COMPILER_H
  10. #include <compiler.h>
  11. #endif
  12.  
  13. #ifndef __MINT__
  14. #define    PATHSIZE    (128)        /* maximum pathname length */
  15. #define    BITSPERBYTE    8
  16. #endif
  17.  
  18.  
  19. #define CHAR_BIT 8
  20.  
  21. #define SCHAR_MAX 127
  22. #define SCHAR_MIN (-128)
  23. #define UCHAR_MAX 255
  24.  
  25. #ifdef __CHAR_UNSIGNED__
  26. #define CHAR_MAX UCHAR_MAX
  27. #define CHAR_MIN 0
  28. #else
  29. #define CHAR_MAX SCHAR_MAX
  30. #define CHAR_MIN SCHAR_MIN
  31. #endif
  32.  
  33. #define SHRT_MAX 32767
  34. #define SHRT_MIN (-32768)
  35. #define LONG_MAX 2147483647L
  36. #define LONG_MIN (-2147483648L)
  37. #define USHRT_MAX 65535U
  38. #define ULONG_MAX 4294967295UL
  39.  
  40. #ifdef __MSHORT__ /* 16 bit ints */
  41. #define INT_MAX SHRT_MAX
  42. #define INT_MIN SHRT_MIN
  43. #define UINT_MAX USHRT_MAX
  44.  
  45. #else /* 32 bit ints */
  46.  
  47. #define INT_MAX 2147483647
  48. #define INT_MIN (-2147483648)
  49. #define UINT_MAX 4294967295U
  50.  
  51. #endif /* __MSHORT__ */
  52.  
  53. #define MB_LEN_MAX    1    /* max. number of bytes in a multibyte character */
  54.  
  55. /*
  56.  * POSIX-specific stuff; see 1003.1 sect. 2.9
  57.  *
  58.  * Note that the library is *not* POSIX compliant; hence
  59.  * the illegally small values for some constants (e.g. _POSIX_LINK_MAX)
  60.  */
  61.  
  62. #define _POSIX_ARG_MAX        4096
  63. #define _POSIX_CHILD_MAX    6
  64. #define _POSIX_LINK_MAX        8
  65. #define _POSIX_MAX_CANON    64    /* <- NON-CONFORMING */
  66. #define _POSIX_MAX_INPUT    64    /* <- NON-CONFORMING */
  67. #define _POSIX_NAME_MAX        14
  68. #define _POSIX_NGROUPS_MAX    0
  69. #define _POSIX_OPEN_MAX        16
  70. #define _POSIX_PATH_MAX        128    /* <- NON-CONFORMING */
  71. #define _POSIX_PIPE_BUF        512
  72.  
  73. #ifndef __STRICT_ANSI__
  74.  
  75. #define NGROUPS_MAX        _POSIX_NGROUPS_MAX
  76. #if 0
  77. /* both of these are actually limited by available memory */
  78. #define ARG_MAX            32767
  79. #define CHILD_MAX        16
  80. #endif
  81.  
  82. #define OPEN_MAX        20
  83. #ifdef __MINT__
  84. # define LINK_MAX        32767
  85. #else
  86. # define LINK_MAX        1
  87. #endif
  88.  
  89. #define MAX_CANON        _POSIX_MAX_CANON
  90. #define MAX_INPUT        _POSIX_MAX_INPUT
  91. #define NAME_MAX        31
  92.         /* actually, MiNT file systems _could_ support more */
  93.  
  94. /* _LIB_NAME_MAX longest name supported in the library
  95.  *  before you change this, please look at stat.c, symdir.c, dirent.[ch],
  96.  *  unx2dos.c.
  97.  *  for the TOS library, this must be atleast 32 to maintain backwards
  98.  *  compatibility.
  99.  */
  100. #ifndef __MINT__
  101. #  define _LIB_NAME_MAX        32 /* CAUTION: dont make this any smaller */
  102. #else
  103. #  define _LIB_NAME_MAX        NAME_MAX
  104. #endif
  105.  
  106. #define PATH_MAX        _POSIX_PATH_MAX
  107. #define PIPE_BUF        _POSIX_PIPE_BUF
  108.  
  109. #endif /* __STRICT_ANSI__ */
  110.  
  111. #endif /* _LIMITS_H */
  112.